Release 10.1A: OpenEdge Development:
Java Open Clients
ProDataGraph function and foundations
The
ProDataGraphclass contains all of the data and schema information required to exchange information with a corresponding ProDataSet or temp-table parameter in an application service. Thus, you can use aProDataGraphparameter to map any of the following parameter types in the application service:As long as the
Note: The only difference is how the schema can be passed for input static and dynamic parameters. For more information, see the "Passing a ProDataGraph as INPUT or INPUT-OUTPUT" section.ProDataGraphis properly prepared, OpenEdge handles all the requirements of passing data between aProDataGraphparameter and the corresponding application service parameter using these different parameter types. This OpenEdge support also guarantees that Java client programming requirements are mostly identical for both static and dynamic versions of equivalent ProDataSet and temp-table parameters.While much of this chapter applies to both individual temp-table and ProDataSet parameters, for more information on passing temp-tables as ProDataGraph parameters, see the "Passing temp-tables as ProDataGraph parameters" section.
Java SDO Foundations
The
Note: If the work of the JSR 235 Expert Group supersedes the current Java SDO API, the OpenEdgeProDataGraphclass is based on theDataGraphinterface specified by the Java Service Data Objects (Java SDO) specification published jointly by BEA and IBM as Java Specification Request (JSR) 235. The OpenEdge class is an extension of the Java SDO reference implementation included as part of the IBM Eclipse Modeling Framework (EMF 2.0.1).ProDataGraphimplementation might have to change in the future.The Java SDO interface specification consists of several interface objects, including the
DataGraph, which closely model the 4GL ProDataSet. Like the ProDataSet, it provides:The
DataObjectis the fundamental interface of Java SDO and is the Java SDO representation of structured data. It encapsulates a specified set of properties (Propertyobjects). Each property has aTypeobject, which can specify one of the following data types:Each
DataObjectprovides read and write access methods for all its properties. (For more information on using the Java SDOPropertyandTypeinterfaces, see the "Using Java SDO classes to access Property meta data" section.)A
DataGraphencapsulates a tree ofDataObjectinstances starting with a single rootDataObject. The reference properties of eachDataObjectlink to otherDataObjectinstances in the tree. In aDataGraphof relational data, aDataObjectcommonly represents a row of data, where its column properties represent the data fields of the row and its reference properties link to ordered or otherwise related rows. Foreign keys are represented by references toDataObjectinstances representing a row or rows in another table. Thus, reference properties can maintain relationships between parent and child tables. The rows of a single table are represented by aDataObjectlist (java.util.List).The
PropertyandTypeinterfaces that define data fields in a table row represented by aDataObjectalso provide the Java SDO meta data API. This API provides access to theDataObjectschema, allowing the client to introspect theDataObjectto get its type information.Thus, the whole character of a
DataGraphdepends on the specific definitions of theDataObjectinstances in its tree. While this tree seems to imply a hierarchical structure, it can be used to model many other complex data structures, depending on how itsDataObjectinstances are defined and interrelated. In order to more closely map a ProDataSet, the OpenEdgeProDataGraphrepresents a constraint on the standardDataGraph. AProDataGraphencapsulates a tree ofProDataObjectinstances, starting with a specially-defined rootDataObject, which essentially references the tables (ProDataObjectlists) contained by theProDataGraphand its corresponding ProDataSet. (For more information on this tree structure, see the "ProDataGraph object model" section.)A
DataGraphalso encapsulates aChangeSummaryobject whose interface tracks changes to any of its underlyingDataObjectinstances. TheChangeSummaryobject is initially empty and populated as theDataGraphis modified. ThisChangeSummaryallows Java SDO to apply changes back to the data source of aDataGraphby comparing changed properties andDataObjectinstances with the current state of the data source. TheProDataGraphclass encapsulates a correspondingProChangeSummaryobject, which extends theChangeSummaryinterface to more closely model the operation of the corresponding ProDataSet.Java SDO also provides components called Data Mediator Services, which provide access to heterogeneous data sources for a
DataGraph. They enable theDataGraphto function independently of any one data source so it can serve as a common unit of transfer for data throughout an application. The OpenEdgeProDataGraphdoes not require Data Mediator Services, as the data source for aProDataGraph(and its corresponding ProDataSet) is typically managed by the OpenEdge application service.For more information on:
- Documentation for the Service Data Objects in EMF 2.0.1, see http://eclipse.org/emf/docs.php.
- JSR 235, see http://www.jcp.org/en/jsr/detail?id=235.
Java SDO extensions
While Java SDO closely models the capabilities of the Progress 4GL ProDataSet, the
ProDataGraphextensions provide additional support to address the following Java SDO limitations:
- Java SDO provides a minimal meta data API that allows clients to introspect data in a
DataGraph. However, to more easily define and access the meta data of aProDataGraph, OpenEdge provides its own classes,ProDataGraphMetaDataandProDataObjectMetaData, to store the schema for aProDataGraph.- Java SDO provides relationship support by allowing a
DataObject(table row) to contain references to otherDataObjectinstances (representing rows in another table). However, it provides no means to describe these relationships as provided for ProDataSets. There is no meta data that describes the field names in the parent and child tables that form the primary-foreign key relationships. OpenEdge provides its ownProDataRelationMetaDataclass to describe each entity relation (data-relation) in aProDataGraph.Note: Java SDO supports the java.util.Date class, but many of its methods are deprecated as of JDK 1.1 because they are not suitable for internationalization.- Java SDO does not support the
java.util.GregorianCalendarclass as a data type forDataObjectfields. This data type is essential to map ProDataSet fields that have theDATETIMEorDATETIME-TZdata type. The OpenEdge ProDataObject class supports thejava.util.GregorianCalendarclass as a data type forProDataObjectfields.- The Java SDO
ChangeSummaryobject that tracks changes to anyDataObjectrows in aDataGraphreturns these changes as a list ofDataObjectrows. However, to efficiently marshall these updates back to the AppServer, these changed rows must be returned to the AppServer as a changes-onlyProDataGraph, which maps to a changes-only ProDataSet in the application service. The OpenEdgeProChangeSummaryclass tracks allProDataObjectchanges and returns them in a changes-onlyProDataGraph.Table 5–1 summarizes all the OpenEdge classes that support the
ProDataGraphextension to Java SDO. They all reside in thecom.progress.open4glpackage. For more information on how these objects work together, in a typicalProDataGraph, see the "ProDataGraph object model" section.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |